home *** CD-ROM | disk | FTP | other *** search
- -----------------------------------------------------------------------------
- 25th June 1992
- -----------------------------------------------------------------------------
- Support Group Application Note
- Number: 010
- Issue: 1
- Author:
- -----------------------------------------------------------------------------
-
- Printing Labels from a View Macro File
-
- -----------------------------------------------------------------------------
- Applicable Hardware: BBC B
- BBC B+
- BBC Master 128
- BBC Master Compact
-
- Related Application Notes:
-
-
- -----------------------------------------------------------------------------
- Copyright (C) Acorn Computers Limited 1992
-
- Every effort has been made to ensure that the information in this leaflet is
- true and correct at the time of printing. However, the products described in
- this leaflet are subject to continuous development and improvements and
- Acorn Computers Limited reserves the right to change its specifications at
- any time. Acorn Computers Limited cannot accept liability for any loss or
- damage arising from the use of any information or particulars in this
- leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
- Limited.
- -----------------------------------------------------------------------------
- Support Group
- Acorn Computers Limited
- Acorn House
- Vision Park
- Histon
- Cambridge CB4 4AE
- -----------------------------------------------------------------------------
-
- The following BASIC listing can be used to print labels from a View file in
- macro format. The program allows the user to select which fields from the
- macro shoul be printed, the order in which they are to be printed and the
- number of lines between each label.
-
- Before running this program critical points that should be noted are:
-
- 1 The printer should be set up and connected to the computer following the
- instructions in the relevant user guides.
-
- 2 The starting position on the printer should be checked and adjusted on a
- short run first to avoid wastage of labels.
-
- 3 The View file should be carefully checked to ensure that all addresses
- have the same number of fields, adding commas where necessary.
-
- 10 REM label print utility
- 20 REM Acorn Computers Ltd (c) 1989
- 30 ON ERROR VDU3 : CLOSE# 0 : REPORT : PRINT "At line " ERL:END
- 40 INPUT"Fields in MACRO "fields%
- 50 INPUT"Lines to print out "lines%
- 60 INPUT"Lines of gap between labels "gap%
- 70 DIM out% (lines%)
- 80 PRINT "enter the position of the entries in the MACRO" :"PRINT "in the order you
- want them printed"
- 90 FOR z% =1 TO lines%:PRINT "Lines "z%"is entry? ";
- 100 INPUT" "out% (z%) :NEXT
- 110 DIM a$ (fields%)
- 120 INPUT"Enter name of file to be printed"mg$
- 130 INPUT "Output of Printer Y/N" q$
- 140 IF INSTR ("Yy",q$) :print=TRUE ELSE print=FALSE
- 150 a%=OPENIN (mg$)
- 160 IF print:VDU2
- 170 PROCnext
- 180 FOR z% = 1 TO fields%
- 190 as (z%) = FNstring
- 200 NEXT
- 210 FOR z% = 1 TO lines%
- 220 PRINT STRING(gap%, CHR$13)
- 230 UNTIL EOF#a%
- 240 DEF PROCnext
- 250 REPEAT d%=BGET#a%:UNTILd%=&80:PTR#a%=PTR#a%+2
- 260 ENDPROC
- 270 DEF FNstring
- 280 LOCAL c%
- 290 r$=" ":REPEAT
- 300 c%=BGET#a%
- 310 IF c%=ASC" , " OR c%=13:UNTIL1: =r$
- 320 r$=r$+CHR$ (c%) :UNTIL0